<?php

$login_rec=$_POST['log'];
$pass_rec=$_POST['password'];

$db=db::getInstance();

$user_select = new UsersListModel();
$filter = array(new DFC(UsersListModel::FIELD_LOGIN, $login_rec, DFC::EXACT),
        new DFC(UsersListModel::FIELD_PASS, $pass_rec, DFC::EXACT));

$user_select=$user_select->findByFilter($db, $filter);

$i=0;

foreach ($user_select as $x)
{
    $i++;
}
if ($i==0)
{
    
    echo "error_login";
    
}

else
    
{
 
    echo "user_index";
session_start();

$_SESSION['login'] = $login_rec;
}
    

?>